import request from '@/utils/request'

//查询医院列表 分页+条件
export function getHospList(current, limit, data) {
  return request({
    url: `/admin/hosp/hospital/list/${current}/${limit}`,
    method: 'GET',
    params: data
  })
}

//根据dictcode查询所有子节点(所有的省)
export function findByDictCode(dictCode) {
  return request({
    url: `/admin/cmn/dict/findByDictCode/${dictCode}`,
    method: 'GET'
  })
}

//根据id查询子节点数据列表
export function findChildId(id) {
  return request({
    url: `/admin/cmn/dict/findChildData/${id}`,
    method: 'GET'
  })
}

//修改医院上线状态
export function updateHospStatus(id, status) {
  return request({
    url: `/admin/hosp/hospital/updateHospStatus/${id}/${status}`,
    method: 'GET'
  })
}

//查看医院详情
export function getHospById(id) {
  return request({
    url: `/admin/hosp/hospital/showHospDetail/${id}`,
    method: 'GET'
  })
}

//查看医院科室
export function getDeptByHoscode(hoscode) {
  return request({
    url: `/admin/hosp/department/getDeptList/${hoscode}`,
    method: 'GET'
  })
}

export function getScheduleRule(page, limit, hoscode, depcode) {
  return request({
    url: `/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`,
    method: 'get'
  })
}

export function getScheduleDetail(hoscode, depcode, workDate) {
  return request({
    url: `/admin/hosp/schedule/getScheduleDetail/${hoscode}/${depcode}/${workDate}`,
    method: 'get'
  })
}
